package com.ruoyi.bizsys.service.impl;

import java.util.List;
import java.util.Arrays;
                                                                    import com.ruoyi.common.utils.DateUtils;
            import org.springframework.stereotype.Service;
    import com.ruoyi.bizsys.mapper.AppFingerprintLogMapper;
import com.ruoyi.bizsys.domain.AppFingerprintLog;
import com.ruoyi.bizsys.service.IAppFingerprintLogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;


/**
 * 设备指纹记录Service业务层处理
 *
 * @author african-loan
 * @date 2021-10-28
 */
@Service
public class AppFingerprintLogServiceImpl extends ServiceImpl<AppFingerprintLogMapper,AppFingerprintLog> implements IAppFingerprintLogService {

    /**
     * 查询设备指纹记录
     *
     * @param id 设备指纹记录ID
     * @return 设备指纹记录
     */
    @Override
    public AppFingerprintLog selectAppFingerprintLogById(Long id) {
        return this.getById(id);
    }

    /**
     * 查询设备指纹记录列表
     *
     * @param appFingerprintLog 设备指纹记录
     * @return 设备指纹记录
     */
    @Override
    public List<AppFingerprintLog> selectAppFingerprintLogList(AppFingerprintLog appFingerprintLog) {
        return this.list(new QueryWrapper<>(appFingerprintLog).last("order by id desc"));
    }

    /**
     * 新增设备指纹记录
     *
     * @param appFingerprintLog 设备指纹记录
     * @return 结果
     */
            @Override
    public int insertAppFingerprintLog(AppFingerprintLog appFingerprintLog) {
                                                                                                                    appFingerprintLog.setCreateTime(DateUtils.getNowDate());
                            return baseMapper.insert(appFingerprintLog);
    }

    /**
     * 修改设备指纹记录
     *
     * @param appFingerprintLog 设备指纹记录
     * @return 结果
     */
            @Override
    public int updateAppFingerprintLog(AppFingerprintLog appFingerprintLog) {
                                                                                                                    return baseMapper.updateById(appFingerprintLog);
    }

    /**
     * 批量删除设备指纹记录
     *
     * @param ids 需要删除的设备指纹记录ID
     * @return 结果
     */
            @Override
    public int deleteAppFingerprintLogByIds(Long[] ids) {
        return baseMapper.deleteBatchIds(Arrays.asList(ids));
    }

    /**
     * 删除设备指纹记录信息
     *
     * @param id 设备指纹记录ID
     * @return 结果
     */
    @Override
    public int deleteAppFingerprintLogById(Long id) {
        return baseMapper.deleteById(id);
    }

}
